#!/usr/bin/env python
#coding:utf-8
import pymysql,time,datetime

date = time.strftime('%Y-%m-%d')
time.strptime(date, '%Y-%m-%d')
j=time.mktime(time.strptime(date,'%Y-%m-%d'))
z=float(j)-86400
day=86400*11

ltime=time.localtime(z-day)
timeStr = time.strftime("%Y%m%d", ltime)
datestrftime=time.strftime('%Y-%m-%d',ltime)


def insert_mysql(sql):
    conn = pymysql.connect(host='121.201.68.21', port=3307, user='jiang', passwd='jiangwenhui', db='daxiangzhanshi',
                           charset='UTF8')
    cur = conn.cursor()
    cur.execute(sql)
    nRet = cur.fetchall()
    conn.commit()

    cur.close()

    conn.close()
    return nRet

if __name__ == "__main__":
    insert ="update jia_provinces_rmb set rmb=rmb+1000"
    insert_mysql(insert)
    insert="update jia_user_zc set zc=zc+10"
    insert_mysql(insert)
    insert="update jia_order_total set total=total+100"
    insert_mysql(insert)